<template>
<div class>
  <head title="Account security"></head>
  <div class="wrapper">
    <div class="locationBox bb" v-if="user.user_name">
      <text class="meth_title">username</text>
      <div class="meth_right">
        <text class="cityName">{{user.user_name}}</text>
      </div>
    </div>
    <div class="locationBox bb" @click="changPhone">
      <text class="meth_title">Change mobile phone number</text>
      <div class="meth_right">
        <text class="cityName">{{user.phone_number}}</text>
        <text class="rightIcon">&#xe6a1;</text>
      </div>
    </div>
    <div class="locationBox bb" @click="gonext('root:app/user/setting/changePw.js')">
      <text class="meth_title">Change account password</text>
      <div class="meth_right">
        <text class="cityName"></text>
        <text class="rightIcon">&#xe6a1;</text>
      </div>
    </div>
    <!-- <div class="locationBox" @click="unsubscribe()">
      <text class="meth_title">unsubscribe</text>
      <div class="meth_right">
        <text class="cityName"></text>
        <text class="rightIcon">&#xe6a1;</text>
      </div>
    </div>-->
    
  </div>
  
  <div class="maskClack" @click="e=>e.stopPropagation()" v-if="isLoading">
    <floading class="indicator" color="#303030"></floading>
  </div>
</div>
</template>

<script>
const navigator = weex.requireModule("navigator");
import asCore from "../../../mixin/core";
export default {
  data() {
    return {
      user: {
        user_name: ""
      }
    };
  },
  created() {
    asCore.getContext(context => {
      
      this.user = Object.assign({}, this.user, context);
    });
  },
  methods: {
    changPhone() {
      if (this.user.phone_number) {
        this.push("root:app/user/setting/changePh.js", {
          phone: this.user.phone_number-0
        });
      } else {
        this.push("root:app/login/bindPhone.js");
      }
    },
  
    gonext(url, parmas) {
      this.push(url, parmas);
    },
    unsubscribe() {
      this.toast("确定注销？");
    }
  }
};
</script>

<style scoped>
.wrapper {
  background-color: #f5f5f5;
  flex: 1;
}

.bb {
  border-bottom-style: solid;
  border-bottom-color: #ededed;
  border-bottom-width: 1px;
}

.locationBox {
  width: 750px;

  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 104px;
  padding: 0 32px;
  /* margin-bottom: 20px; */
  background-color: #ffffff;
}

.meth_title {
  color: #323232;
  font-size: 26px;
  width: 353px;
}

.meth_right {
  flex: 1;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}

.cityName {
  font-size: 28px;
  color: #999999;
  flex: 1;
  text-align: right;
}

.rightIcon {
  font-family: iconfont;
  font-size: 26px;
  color: #999;
  margin-left: 30px;
}
</style>
